home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume19 / fbm / part01 next >
Encoding:
Internet Message Format  |  1989-06-08  |  59.3 KB

  1. Subject:  v19i047:  FBM, image manipulation library, Part01/08
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: Michael.Mauldin@NL.CS.CMU.EDU
  7. Posting-number: Volume 19, Issue 47
  8. Archive-name: fbm/part01
  9.  
  10. The Fuzzy Pixmap Manipulation (FBM) library of programs, in combination
  11. with Jef Poskanzer's PBM collection, provides a complete package for
  12. manipulating and converting color and black and whites images,
  13. including 24bit RGB, 8bit mapped color, 8bit grayscale, and 1bit
  14. bitmapped images.
  15.  
  16. The tools include:
  17.     clr2gray  Convert color to grayscale
  18.     fbcat      Copy image (used for format conversion)
  19.     fbclean      Flip isolated pixels (clean image)
  20.     fbedge      Compute derivative image (edge detection)
  21.     fbext      Extract region, resize, change aspect ratio
  22.     fbhalf      Halftone grayscale image (Blue noise, Floyd-Steinberg, etc)
  23.     fbhist      Compute histogram
  24.     fbinfo      Dump image header
  25.     fbm2pod      Convert grayscale image to Diablo graphics (!)
  26.     fbmask      Set region to gray value
  27.     fbnorm      Normalize image intensity / increase contrast
  28.     fbps      Convert to PostScript
  29.     fbquant      Color quantization (24 bit to 8..256 colors) Mod. Heckbert
  30.     fbrot      Rotate 90, 180, or 270 degrees
  31.     fbsample  Sample a 1bit file to produce an 8bit file
  32.     fbsharp      Sharpen (edge enhancement) by digital Laplacian
  33.     gray2clr  Add a "gray" colormap to a grayscale image
  34.     idiff      (and udiff) convert raw byte stream into byte difference
  35.     pbm2ps      Convert PBM file to PostScript
  36.     pbmtitle  Add a title to a PBM file
  37.     raw2fbm      Convert raw file to FBM format (eg: Amiga Digiview files)
  38.  
  39. #! /bin/sh
  40. # This is a shell archive.  Remove anything before this line, then unpack
  41. # it by saving it into a file and typing "sh file".  To overwrite existing
  42. # files, type "sh file -c".  You can also feed this as standard input via
  43. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  44. # will see the following message at the end:
  45. #        "End of archive 1 (of 8)."
  46. # Contents:  MANIFEST README README.lib clr2gray.1 fbclean.1 fbedge.1
  47. #   fbham.1 fbhist.1 fbinfo.1 fbm2pod.1 fbm2tga.c fbmask.1 fbnorm.1
  48. #   fbps.1 fbrot.1 fbsharp.1 flalfb.c flpic.c gray2clr.1 idiff.1
  49. #   idiff.c pbm2ps.1 pbmtitle.1 pbmtitle.c pic2fbm.c qrt2fbm.1
  50. #   raw2fbm.1 tga2fbm.c
  51. # Wrapped by rsalz@fig.bbn.com on Fri Jun  9 08:38:19 1989
  52. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  53. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  54.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  55. else
  56. echo shar: Extracting \"'MANIFEST'\" \(2638 characters\)
  57. sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  58. X   File Name        Archive #    Description
  59. X-----------------------------------------------------------
  60. X Features                   3    
  61. X MANIFEST                   1    
  62. X Makefile                   6    
  63. X README                     1    
  64. X README.lib                 1    
  65. X clr2gray.1                 1    
  66. X clr2gray.c                 2    
  67. X fbcat.1                    2    
  68. X fbcat.c                    2    
  69. X fbclean.1                  1    
  70. X fbclean.c                  2    
  71. X fbedge.1                   1    
  72. X fbedge.c                   2    
  73. X fbext.1                    2    
  74. X fbext.c                    5    
  75. X fbhalf.1                   3    
  76. X fbhalf.c                   4    
  77. X fbham.1                    1    
  78. X fbham.c                    7    
  79. X fbhist.1                   1    
  80. X fbhist.c                   2    
  81. X fbinfo.1                   1    
  82. X fbinfo.c                   2    
  83. X fbm.1                      4    
  84. X fbm.h                      3    
  85. X fbm2pod.1                  1    
  86. X fbm2pod.c                  4    
  87. X fbm2tga.c                  1    
  88. X fbmask.1                   1    
  89. X fbmask.c                   2    
  90. X fbnorm.1                   1    
  91. X fbnorm.c                   3    
  92. X fbps.1                     1    
  93. X fbps.c                     5    
  94. X fbquant.1                  2    
  95. X fbquant.c                  8    
  96. X fbrot.1                    1    
  97. X fbrot.c                    2    
  98. X fbsample.1                 2    
  99. X fbsample.c                 3    
  100. X fbsharp.1                  1    
  101. X fbsharp.c                  2    
  102. X flalfb.c                   1    
  103. X flblue.c                   4    
  104. X flbyte.c                   3    
  105. X flcavg.c                   2    
  106. X flclr.c                    5    
  107. X fledge.c                   5    
  108. X flextr.c                   4    
  109. X flface.c                   3    
  110. X flflyd.c                   3    
  111. X flgifc.c                   6    
  112. X flgife.c                   4    
  113. X flgifr.c                   7    
  114. X flgifw.c                   3    
  115. X fliff.c                    7    
  116. X flklnr.c                   5    
  117. X flpbm.c                    4    
  118. X flpcx.c                    6    
  119. X flpic.c                    1    
  120. X flrdfb.c                   3    
  121. X flread.c                   3    
  122. X flrot.c                    4    
  123. X flshrp.c                   4    
  124. X flsun.c                    5    
  125. X fltga.c                    6    
  126. X flthre.c                   2    
  127. X flwrfb.c                   2    
  128. X gray2clr.1                 1    
  129. X gray2clr.c                 2    
  130. X idiff.1                    1    
  131. X idiff.c                    1    
  132. X pbm2ps.1                   1    
  133. X pbm2ps.c                   5    
  134. X pbmtitle.1                 1    
  135. X pbmtitle.c                 1    
  136. X pic2fbm.c                  1    
  137. X qrt2fbm.1                  1    
  138. X qrt2fbm.c                  2    
  139. X raw2fbm.1                  1    
  140. X raw2fbm.c                  3    
  141. X tga2fbm.c                  1    
  142. END_OF_FILE
  143. if test 2638 -ne `wc -c <'MANIFEST'`; then
  144.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  145. fi
  146. # end of 'MANIFEST'
  147. fi
  148. if test -f 'README' -a "${1}" != "-c" ; then 
  149.   echo shar: Will not clobber existing file \"'README'\"
  150. else
  151. echo shar: Extracting \"'README'\" \(5911 characters\)
  152. sed "s/^X//" >'README' <<'END_OF_FILE'
  153. XThis directory contains the Beta test release (version 0.9) of the
  154. XFuzzy Pixmap Manipulation (FBM) library of programs.  This collection
  155. X(in combination with Jef Poskanzer's PBM collection) provides a
  156. Xcomplete package for manipulating and converting color and black and
  157. Xwhites images, including 24bit RGB, 8bit mapped color, 8bit grayscale,
  158. Xand 1bit bitmapped images.
  159. X
  160. XCompilation
  161. X
  162. X    Unpack all files in one directory.  Edit Makefile and put in
  163. X    appropriate values for 
  164. X
  165. XFile Formats
  166. X
  167. X    FBM   (-F)    FBM file with 256 byte header (with title & credits)
  168. X    Sun   (-S)    Sun rasterfile with 32 byte header
  169. X    PBM   (-P)    Poskanzer format for 1bit files
  170. X    GIF   (-G)    CompuServe GIF format
  171. X    IFF   (-I)    Amiga IFF files (except HAM mode files)
  172. X    PCX   (-Z)    PC PaintBrush format for IBM
  173. X    Face  (-B)    Bennet Yee's 1bit files, used at CMU
  174. X
  175. X    All programs (except fbinfo) can read any of the formats, and use
  176. X    the magic number to decide the file type.  If the input is not a
  177. X    pipe and is compressed using the net standard 'compress' program,
  178. X    the file will be uncompressed as it is read.  Note however that 
  179. X    the operation to be performed must make sense; that is you cannot
  180. X    halftone a color image, quantize a grayscale image, or resize a
  181. X    1bit file.
  182. X
  183. XFiles and Programs:
  184. X
  185. X    README        This file
  186. X    README.lib    Lists the subroutines in libfbm.a
  187. X    Makefile    Make utility configuration file
  188. X    fbm.1        General manual entry
  189. X    *.1        Individual manual entries
  190. X    fbm.h        Defines FBM data structures
  191. X
  192. X    clr2gray  Convert color to grayscale
  193. X    fbcat      Copy image (used for format conversion)
  194. X    fbclean      Flip isolated pixels (clean image)
  195. X    fbedge      Compute derivative image (edge detection)
  196. X    fbext      Extract region, resize, change aspect ratio
  197. X    fbhalf      Halftone grayscale image (Blue noise, Floyd-Steinberg, etc)
  198. X    fbhist      Compute histogram
  199. X    fbinfo      Dump image header
  200. X    fbm2pod      Convert grayscale image to Diablo graphics (!)
  201. X    fbmask      Set region to gray value
  202. X    fbnorm      Normalize image intensity / increase contrast
  203. X    fbps      Convert to PostScript
  204. X    fbquant      Color quantization (24 bit to 8..256 colors) Mod. Heckbert
  205. X    fbrot      Rotate 90, 180, or 270 degrees
  206. X    fbsample  Sample a 1bit file to produce an 8bit file
  207. X    fbsharp      Sharpen (edge enhancement) by digital Laplacian
  208. X    gray2clr  Add a "gray" colormap to a grayscale image
  209. X    idiff      (and udiff) convert raw byte stream into byte difference
  210. X    pbm2ps      Convert PBM file to PostScript
  211. X    pbmtitle  Add a title to a PBM file
  212. X    raw2fbm      Convert raw file to FBM format (eg: Amiga Digiview files)
  213. X
  214. X
  215. X
  216. XExtensions
  217. X
  218. X    Several file extension conventions are used, but none are enforced
  219. X
  220. X    .Z        Compressed file, appended to other extensions
  221. X
  222. X    .fbm        Standard extension for FBM format files
  223. X    .cbm        Sometimes used to mean a 24bit color FBM file
  224. X
  225. X    .ip        8bit grayscale Amiga file (with 1.2 aspect ratio)
  226. X    .cp        24bit color Amiga file (with 1.2 aspect ratio)
  227. X
  228. X    .1bit        Sun 1bit rastefile
  229. X    .clr        Sometimes used to mean a 8bit mapped color Sun file
  230. X
  231. X    .bm        Bennet Yee's "Face" format (1bit)
  232. X    .pbm        Poskanzer 1bit format
  233. X    .gif        Compuserve GIF format
  234. X    .pcx        ZSoft's PCPaintbrush format
  235. X
  236. XExample Unix pipelines to view files:
  237. X
  238. X    Starting with an 8 bit raw Amiga grayscale file, foo.ip, first
  239. X    create an FBM format file with a title and credit, then process
  240. X    that file for viewing on a Sun screen by normalizing, rotating,
  241. X    resizing, sharpening, and halftoning.
  242. X
  243. X    % raw2fbm -d1 -a1.2 -w640 -h400 \
  244. X      -t'Random Title' -c'Random Credit' < foo.ip > foo.fbm
  245. X
  246. X    % fbinfo foo.fbm
  247. X    foo.fbm            "Random Title"
  248. X            [ Random Credit ]
  249. X            [640x400x8]    8 physbits  1.2 aspect ratio
  250. X            row length 640, plane length 256000, colormap length 0
  251. X
  252. X
  253. X    % fbnorm < foo.fbm | \            (normalize)
  254. X      fbrot | \                (rotate 90 deg clockwise)
  255. X      fbext -a1 -W900 -H768 | \        (resize & make aspect ratio 1)
  256. X      fbhalf -s10 -S > foo.1bit        (sharpen, halftone, write Sun)
  257. X
  258. X
  259. X
  260. X    Starting with a 24 bit color Amiga file, bar.cp, first create an
  261. X    FBM format file with title and credit, then render that file for
  262. X    viewing on a Sun by normalizing, rotating, sharpening, and
  263. X    quantizing.
  264. X
  265. X    % raw2fbm -d3 -a1.2 -w640 -h400 \
  266. X      -t'Random Color Title' -c'Random Color Credit' < bar.cp > bar.cbm
  267. X
  268. X    % fbinfo bar.cbm
  269. X    bar.cbm            "Random Color Title"
  270. X            [ Random Color Credit ]
  271. X            [3x640x400x8]    8 physbits  1.2 aspect ratio
  272. X            row length 640, plane length 256000, colormap length 0
  273. X
  274. X
  275. X    % fbnorm < bar.cbm | \            (normalize)
  276. X      fbrot | \                (rotate 90 deg clockwise)
  277. X      fbext -a1 -W900 -H768 | \        (resize & make aspect ratio 1)
  278. X      fbsharp 3.0 | \            (sharpen it)
  279. X      fbquant -S > bar.clr            (quantize and write Sun)
  280. X
  281. X    (Note that sharpening is an integral option to the halftoning
  282. X     program using the -s option, but that color images must currently
  283. X     be sharpened using a separate program.  Note also that more
  284. X     sharpening is used on black and white images than on color images).
  285. X
  286. XNotes on the 'fbext' program
  287. X
  288. X    Usage:    fbext [ -w<width> -h<height> -W<maxwdith> -H<maxheight>
  289. X                -s<size> -a<aspect> -t'title' -c'credits' ]
  290. X             [ x y [ width height ] ]
  291. X        < foo.fbm > bar.fbm
  292. X
  293. X    fbext (bitmap extract) is a very useful anmd multipurpose program.
  294. X    Its basic operation is to copy a rectangular portion of one image
  295. X    (color or black and white) to a second image, possibly changing
  296. X    either the width or height or both.  It can also change the title
  297. X    or credits fields of the image.  Because it is so versatile, there
  298. X    are a host of options:
  299. X
  300. X    -w<num>  or  -h<num>    Force width and/or height to a certain size
  301. X    -W<num>  or  -H<num>    Limit width and height to a certain size
  302. X    -a<num>            Force the output to have a given aspect ratio
  303. X    -s<num>            Scale image to have no more than a given
  304. X                number of pixels.
  305. X    <x0> <y0> <width> <height>  select a rectangular region of the image
  306. X                to extract.  The default is the entire image.
  307. X
  308. X    Note that the output size limits are cumulative.  Thus if you set a
  309. X    maximum width, height, and number of pixels, the image will be the
  310. X    smallest of the three limits.
  311. X
  312. END_OF_FILE
  313. if test 5911 -ne `wc -c <'README'`; then
  314.     echo shar: \"'README'\" unpacked with wrong size!
  315. fi
  316. # end of 'README'
  317. fi
  318. if test -f 'README.lib' -a "${1}" != "-c" ; then 
  319.   echo shar: Will not clobber existing file \"'README.lib'\"
  320. else
  321. echo shar: Extracting \"'README.lib'\" \(1823 characters\)
  322. sed "s/^X//" >'README.lib' <<'END_OF_FILE'
  323. XThis directory contains the source for the FBM bitmap manipulation
  324. Xlibrary.  The commands implemented allow for resizing, retoning and
  325. Xrendering of both grayscale and color bitmaps, as well as conversions
  326. Xto and from a variety of other formats including PBM, Bennet Yee's
  327. XFACE format, and Sun rasterfiles.
  328. X
  329. XSeparate compilation files for libfbm.a:
  330. X
  331. X    flalfb.c: 
  332. X        alloc_fbm (image)
  333. X        free_fbm (image)
  334. X    flblue.c: 
  335. X        bluenoise_fbm (input, output, noiselevel)
  336. X    flbyte.c:
  337. X        get_long (rfile, order)
  338. X        get_short (rfile, order)
  339. X        put_long (long, wfile, order)
  340. X        put_short (word, wfile, order)
  341. X        machine_byte_order ()
  342. X    flcavg.c: 
  343. X        constravg_fbm (input, output, gamma)
  344. X    flclr.c:
  345. X        clr2gray (input, output, rw, gw, bw)
  346. X        gray2clr (input, output, rw, gw, bw)
  347. X    fledge.c:
  348. X        findedge_fbm (&image, beta)
  349. X    flextr.c: 
  350. X        extract_fbm (input, output, xo, yo, w, h, ow, oh,
  351. X                 title, credits)
  352. X    flface.c: 
  353. X        write_face (image, stream)
  354. X        read_face (image, stream , mstr, mlen)
  355. X    flflyd.c: 
  356. X        floyd_fbm (input, output)
  357. X    flgifc.c:
  358. X    flgife.c:
  359. X    flgifr.c:
  360. X        read_gif (image, infile, mstr, mlen)
  361. X    flgifw.c:
  362. X        write_gif (image, infile)
  363. X    fliff.c:
  364. X        read_iff (image, infile, mstr, mlen)
  365. X        write_iff (image, infile)
  366. X    flklnr.c:
  367. X        clean_fbm (input, output, beta, gamma, nbr)
  368. X    flpbm.c: 
  369. X        read_pbm (image, infile, mstr, mlen)
  370. X        write_pbm (image, stream)
  371. X    flpcx.c:
  372. X        read_pcx (image, rfile, mstr, mlen)
  373. X    flrdfb.c: 
  374. X        read_fbm (image, rfile, mstr, mlen)
  375. X        read_hdr_fbm (image, rfile, mstr, mlen)
  376. X    flread.c:
  377. X        read_bitmap (image, rfname)
  378. X        write_bitmap (image, wfile, type)
  379. X    flrot.c:
  380. X        rotate_fbm (input, output, rot)
  381. X    flshrp.c: 
  382. X        sharpen_fbm (input, output, beta)
  383. X    flsun.c:
  384. X        read_sun (image, rfile, mstr, mlen)
  385. X        write_sun (image, wfile)
  386. X    flhtre.c:
  387. X        thesh_fbm (input, output, thresh)
  388. X    flwrfb.c: 
  389. X        write_fbm (image, wfile)
  390. X        write_hdr_fbm (image, wfile)
  391. END_OF_FILE
  392. if test 1823 -ne `wc -c <'README.lib'`; then
  393.     echo shar: \"'README.lib'\" unpacked with wrong size!
  394. fi
  395. # end of 'README.lib'
  396. fi
  397. if test -f 'clr2gray.1' -a "${1}" != "-c" ; then 
  398.   echo shar: Will not clobber existing file \"'clr2gray.1'\"
  399. else
  400. echo shar: Extracting \"'clr2gray.1'\" \(1853 characters\)
  401. sed "s/^X//" >'clr2gray.1' <<'END_OF_FILE'
  402. X.TH CLR2GRAY 1 07-Mar-89
  403. X.CM 3
  404. X.SH NAME
  405. Xclr2gray \- Convert color images to grayscale
  406. X.SH SYNOPSIS
  407. X.nf
  408. Xclr2gray [ -r<red> -g<grn> -b<blu> ] [ -<type> ] < color > gray
  409. X.fi
  410. X.SH DESCRIPTION
  411. X.PP
  412. XConverts a color image (8bit or 24bit) to an 8 bit grayscale image.
  413. XIt works for both mapped and unmapped color inputs.
  414. X.SH OPTIONS
  415. X.TP
  416. X.BR -r<num>, -g<num>, -b<num>
  417. X.I weights,
  418. Xused to convert the triple <red,green,blue> to a scalar intensity
  419. Xvalue.  If one or more weights are specified, those not specified
  420. Xdefault to zero.   If no weights are specified, NTSC weights (29.9%
  421. Xred, 58.7% green, 11.4% blue) are used.
  422. X.TP
  423. X.BR -B
  424. X.I face
  425. Xformat, as used by Bennet Yee's
  426. X.I face
  427. Xprogram at CMU. 
  428. X.TP
  429. X.BR -F
  430. X.I FBM,
  431. Xformat (by default, the default).  You are guaranteed not
  432. Xto lose information by specifying FBM as the default.
  433. X.TP
  434. X.BR -G
  435. X.I GIF,
  436. XCompuserve GIF format.
  437. X.TP
  438. X.BR -I
  439. X.I IFF
  440. Xformat, interleaved bitmaps (ILBM), used by Amigas.
  441. X.TP
  442. X.BR -P
  443. X.I PBM,
  444. XJef Poskanzer's bitmap format.
  445. X.TP
  446. X.BR -S
  447. X.I sun,
  448. XSun rasterfiles (not run length encoded).
  449. X.SH EXAMPLE
  450. X.PP
  451. XTo convert a mapped color image in FBM format to a Sun
  452. Xformat grayscale image:
  453. X.sp
  454. X    % clr2gray -S < foo.fbm > foo.8bit
  455. X.sp
  456. XTo extract the red color plane from an image and write the result in
  457. XFBM format:
  458. X.sp
  459. X    % clr2gray -r1 -F < foo.fbm > red.fbm
  460. X.sp
  461. XNote that since the green and blue weights were not specified, they
  462. Xdefaulted to 0, and the result is that only the red plane is used.
  463. X.SH SEE ALSO
  464. Xfbm(1) for general discussion, pbm(1) for PBM routines.
  465. X.SH BUGS
  466. XNone known.
  467. X.SH HISTORY
  468. XCopyright (c) 1989 by Michael L. Mauldin.  
  469. XPermission is granted to use this program in whole or in part provided
  470. Xthat you do not sell it for profit and that this copyright notice is
  471. Xretained unchanged.
  472. X.TP
  473. X07-Mar-89  Michael L. Mauldin at Carnegie Mellon University
  474. XBeta release (version 0.9) mlm@cs.cmu.edu
  475. END_OF_FILE
  476. if test 1853 -ne `wc -c <'clr2gray.1'`; then
  477.     echo shar: \"'clr2gray.1'\" unpacked with wrong size!
  478. fi
  479. # end of 'clr2gray.1'
  480. fi
  481. if test -f 'fbclean.1' -a "${1}" != "-c" ; then 
  482.   echo shar: Will not clobber existing file \"'fbclean.1'\"
  483. else
  484. echo shar: Extracting \"'fbclean.1'\" \(1918 characters\)
  485. sed "s/^X//" >'fbclean.1' <<'END_OF_FILE'
  486. X.TH FBCLEAN 1 07-Mar-89
  487. X.CM 3
  488. X.SH NAME
  489. Xfbclean \- flip isolated pixels in a 1bit image
  490. X.SH SYNOPSIS
  491. X.nf
  492. Xfbclean [ -b<cleaner> -t<threshhold> -n<nbr> ] [ -<type> ] < bitmap > bitmap
  493. X.fi
  494. X.SH DESCRIPTION
  495. X.PP
  496. XFlips isolated pixels (this can be used to clean up "snow" in some
  497. Xhalftoned images.  Can also convert a grayscale image to bitmap by
  498. Xtheshholding before the cleaning is done.
  499. X.SH OPTIONS
  500. X.TP
  501. X.B -b
  502. X.I cleaner
  503. Xoption, specifies the minimum number of "nearby" like pixels to remain
  504. Xthe same color.
  505. X.TP
  506. X.B -n
  507. X.I neighbors,
  508. Xthe size of the neighborhood.  To be "nearby" means to be located in an
  509. XNxN square around the target pixel.
  510. X.TP
  511. X.B -t
  512. X.I threshhold
  513. Xcommand, used to halftone the image before cleaning.  The default is no
  514. Xtheshholding.
  515. X.TP
  516. X.BR -B
  517. X.I face
  518. Xformat, as used by Bennet Yee's
  519. X.I face
  520. Xprogram at CMU. 
  521. X.TP
  522. X.BR -F
  523. X.I FBM,
  524. Xformat (by default, the default).  You are guaranteed not
  525. Xto lose information by specifying FBM as the default.
  526. X.TP
  527. X.BR -G
  528. X.I GIF,
  529. XCompuserve GIF format.
  530. X.TP
  531. X.BR -I
  532. X.I IFF
  533. Xformat, interleaved bitmaps (ILBM), used by Amigas.
  534. X.TP
  535. X.BR -P
  536. X.I PBM,
  537. XJef Poskanzer's bitmap format.
  538. X.TP
  539. X.BR -S
  540. X.I sun,
  541. XSun rasterfiles (not run length encoded).
  542. X.PP
  543. X.SH EXAMPLE
  544. X.PP
  545. XTo take a bitmap and clean up pixels with fewer than 2 like neighbors
  546. Xin the surrounding 5x5 square, outputing s Sun rasterfile:
  547. X.sp
  548. X   % fbclean -S -b2 -n5 < foo.1bit > bar.1bit
  549. X.sp
  550. XTo do the same thing to a grayscale file (threshholding first with 128):
  551. X.sp
  552. X    % fbclean -S -b2 -n5 -t128 < foo.1bit > bar.1bit
  553. X.SH SEE ALSO
  554. Xfbm(1) for general discussion, pbm(1) for PBM routines.
  555. X.SH BUGS
  556. XNone known.
  557. X.SH HISTORY
  558. XCopyright (c) 1989 by Michael L. Mauldin.  
  559. XPermission is granted to use this program in whole or in part provided
  560. Xthat you do not sell it for profit and that this copyright notice is
  561. Xretained unchanged.
  562. X.TP
  563. X07-Mar-89  Michael L. Mauldin at Carnegie Mellon University
  564. XBeta release (version 0.9) mlm@cs.cmu.edu
  565. END_OF_FILE
  566. if test 1918 -ne `wc -c <'fbclean.1'`; then
  567.     echo shar: \"'fbclean.1'\" unpacked with wrong size!
  568. fi
  569. # end of 'fbclean.1'
  570. fi
  571. if test -f 'fbedge.1' -a "${1}" != "-c" ; then 
  572.   echo shar: Will not clobber existing file \"'fbedge.1'\"
  573. else
  574. echo shar: Extracting \"'fbedge.1'\" \(1547 characters\)
  575. sed "s/^X//" >'fbedge.1' <<'END_OF_FILE'
  576. X.TH FBEDGE 1 07-Mar-89
  577. X.CM 3
  578. X.SH NAME
  579. Xfbedge \- compute the derivative of an image (edge detection)
  580. X.SH SYNOPSIS
  581. X.nf
  582. Xfbedge [ -t<threshhold> ] [ -<type> ] < bitmap > bitmap
  583. X.fi
  584. X.SH DESCRIPTION
  585. X.PP
  586. XComputes a halftoned image composed of edges in the original.  Edge
  587. Xdetection is done by digital Laplacian.
  588. X.SO OPTIONS
  589. X.TP
  590. X.B -t<num>
  591. X.I threshhold
  592. Xargument, specifies a threshhold for detecting edges.  Pixels with
  593. Xfirst derivatives greater than the threshhold will be black, and others
  594. Xwill be white.
  595. X.TP
  596. X.BR -B
  597. X.I face
  598. Xformat, as used by Bennet Yee's
  599. X.I face
  600. Xprogram at CMU. 
  601. X.TP
  602. X.BR -F
  603. X.I FBM,
  604. Xformat (by default, the default).  You are guaranteed not
  605. Xto lose information by specifying FBM as the default.
  606. X.TP
  607. X.BR -G
  608. X.I GIF,
  609. XCompuserve GIF format.
  610. X.TP
  611. X.BR -I
  612. X.I IFF
  613. Xformat, interleaved bitmaps (ILBM), used by Amigas.
  614. X.TP
  615. X.BR -P
  616. X.I PBM,
  617. XJef Poskanzer's bitmap format.
  618. X.TP
  619. X.BR -S
  620. X.I sun,
  621. XSun rasterfiles (not run length encoded).
  622. X.SH EXAMPLE
  623. X.PP
  624. XTo produce an image of regions in a grayscale image where the first
  625. Xderivative is greater than 10, and output the result as a Sun
  626. Xrasterfile:
  627. X.sp
  628. X    % fbedge -t10 -S < foo.gray > foo.1bit
  629. X.SH SEE ALSO
  630. Xfbm(1) for general discussion, pbm(1) for PBM routines.
  631. X.SH BUGS
  632. XNone known.
  633. X.SH HISTORY
  634. XCopyright (c) 1989 by Michael L. Mauldin.  
  635. XPermission is granted to use this program in whole or in part provided
  636. Xthat you do not sell it for profit and that this copyright notice is
  637. Xretained unchanged.
  638. X.TP
  639. X07-Mar-89  Michael L. Mauldin at Carnegie Mellon University
  640. XBeta release (version 0.9) mlm@cs.cmu.edu
  641. END_OF_FILE
  642. if test 1547 -ne `wc -c <'fbedge.1'`; then
  643.     echo shar: \"'fbedge.1'\" unpacked with wrong size!
  644. fi
  645. # end of 'fbedge.1'
  646. fi
  647. if test -f 'fbham.1' -a "${1}" != "-c" ; then 
  648.   echo shar: Will not clobber existing file \"'fbham.1'\"
  649. else
  650. echo shar: Extracting \"'fbham.1'\" \(1502 characters\)
  651. sed "s/^X//" >'fbham.1' <<'END_OF_FILE'
  652. X.TH FBHAM 1 20-May-89
  653. X.CM 3
  654. X.SH NAME
  655. Xfbham \- Convert 24 bit RGB color to Amiga HAM mode
  656. X.SH SYNOPSIS
  657. X.nf
  658. Xfbham < image.cbm > image.ham
  659. X.fi
  660. X.SH DESCRIPTION
  661. X.PP
  662. X.I fbham
  663. Xreads a 24bit color image and produces Amiga HAM mode.  The output is
  664. Xan IFF ILBM file with 6 planes.  The first two bits of a pixel specify
  665. Xan operation and the last four bits specify a color.  The operations
  666. Xare:
  667. X.sp
  668. X.nf
  669. X   00    Use the 4bit value as in index into the color table.
  670. X   01    Copy the RGB values for the pixel to the immediate left,
  671. X      using the 4bit value to change the intensity of the red
  672. X    gun.  The new red value will be the 4bit value shifted
  673. X    left 4 bits (so 0,1,...15 maps to 0,16,...240).
  674. X   02    Same as above, but change green gun.
  675. X   03    Same as above, but change blue gun.
  676. X.fi
  677. X.sp
  678. XIf your input image is not 24 bits, use unmap(1) to convert almost any
  679. Xcolor image to 24 bits.
  680. X.SH OPTIONS
  681. X.PP
  682. XNone.
  683. X.SH SEE ALSO
  684. Xfbm(1) for general discussion, pbm(1) for PBM routines.
  685. X.SH BUGS
  686. XReally lousy choice for initial colormap.  Should use the
  687. Xbuild_colormap routine from fbquant.
  688. X.SH HISTORY
  689. XCopyright (c) 1989 by Michael L. Mauldin.  
  690. XPermission is granted to use this program in whole or in part provided
  691. Xthat you do not sell it for profit and that this copyright notice is
  692. Xretained unchanged.
  693. X.TP
  694. X20-May-89  Michael L. Mauldin at Carnegie Mellon University
  695. XWrote this man page.  Software by C. Harald Koch (chk) at DCIEM Toronto
  696. X<chk@ben.dciem.dnd.ca>, based on ray2.c from DBW_Render, Copyright 1987
  697. XDavid B. Wecker.
  698. END_OF_FILE
  699. if test 1502 -ne `wc -c <'fbham.1'`; then
  700.     echo shar: \"'fbham.1'\" unpacked with wrong size!
  701. fi
  702. # end of 'fbham.1'
  703. fi
  704. if test -f 'fbhist.1' -a "${1}" != "-c" ; then 
  705.   echo shar: Will not clobber existing file \"'fbhist.1'\"
  706. else
  707. echo shar: Extracting \"'fbhist.1'\" \(1561 characters\)
  708. sed "s/^X//" >'fbhist.1' <<'END_OF_FILE'
  709. X.TH FBHIST 1 07-Mar-89
  710. X.CM 3
  711. X.SH NAME
  712. Xfbhist \- compute histogram of an image
  713. X.SH SYNOPSIS
  714. X.nf
  715. Xfbhist [ -h ] < image
  716. X.fi
  717. X.SH DESCRIPTION
  718. X.PP
  719. XPrints some of the header info and displays the maximum, minimum, mean,
  720. Xand standard deviation of the gray levels.  If given any argument it
  721. Xalso dumps the histogram.  Works correctly for black and white images.
  722. XOn color images it will work, but the results for images with odd
  723. Xwidths will include the zeroes used to pad to an even byte boundary.
  724. X.sp
  725. X.TP
  726. X.B -h
  727. X.I histogram
  728. Xargument requests printing the actual counts for all gray levels used
  729. Xby the image.
  730. X.SH EXAMPLE
  731. X.PP
  732. XTo compute the mean and range of an image:
  733. X.sp
  734. X.nf
  735. X    % fbhist < tiger.fbm
  736. X    Tiger [400x640  8 bits  0.833 aspect ratio]
  737. X    Mean 88.83 +- 40.94, range 21..201
  738. X.fi
  739. X.sp
  740. XThe output shows that the image is title 'Tiger', and that it is 400
  741. Xpixels wide and 640 pixels tall.  The pixels are 8 bits deep, and the
  742. Ximage has a 0.833 aspect ratio (it is a rotated version of a 1.2 to 1
  743. Ximage).  The average density is 88.83 with a standard deviation of
  744. X40.94.  Pixels range from values 21 (darkest) to 201 (lightest) out of
  745. Xa 0..255 range.
  746. X.SH SEE ALSO
  747. Xfbm(1) for general discussion, pbm(1) for PBM routines.
  748. X.SH BUGS
  749. XNone known.
  750. X.SH HISTORY
  751. XCopyright (c) 1989 by Michael L. Mauldin.  
  752. XPermission is granted to use this program in whole or in part provided
  753. Xthat you do not sell it for profit and that this copyright notice is
  754. Xretained unchanged.
  755. X.TP
  756. X07-Mar-89  Michael L. Mauldin at Carnegie Mellon University
  757. XBeta release (version 0.9) mlm@cs.cmu.edu
  758. END_OF_FILE
  759. if test 1561 -ne `wc -c <'fbhist.1'`; then
  760.     echo shar: \"'fbhist.1'\" unpacked with wrong size!
  761. fi
  762. # end of 'fbhist.1'
  763. fi
  764. if test -f 'fbinfo.1' -a "${1}" != "-c" ; then 
  765.   echo shar: Will not clobber existing file \"'fbinfo.1'\"
  766. else
  767. echo shar: Extracting \"'fbinfo.1'\" \(966 characters\)
  768. sed "s/^X//" >'fbinfo.1' <<'END_OF_FILE'
  769. X.TH FBINFO 1 07-Mar-89
  770. X.CM 3
  771. X.SH NAME
  772. Xfbinfo \- dump the contents of an FBM image header
  773. X.SH SYNOPSIS
  774. X.nf
  775. Xfbinfo files...
  776. X.fi
  777. X.SH DESCRIPTION
  778. X.PP
  779. XDump the header information  of one or more files.  If the file name
  780. Xends in ".Z", the file is uncompressed before the header is read.
  781. XNote that compressed files that don't have ".Z" at the end won't work.
  782. X.SH EXAMPLE
  783. X.PP
  784. Xfbinfo *.fbm
  785. X.PP
  786. X.SH SEE ALSO
  787. Xfbm(1) for general discussion, pbm(1) for PBM routines.
  788. X.SH BUGS
  789. XShould be expanded to work for all readable image formats.  As a work
  790. Xaround you can use fbhist(1) which does read all formats (using
  791. Xsignificantly more time and cpu).
  792. X
  793. XNone known.
  794. X.SH HISTORY
  795. XCopyright (c) 1989 by Michael L. Mauldin.  
  796. XPermission is granted to use this program in whole or in part provided
  797. Xthat you do not sell it for profit and that this copyright notice is
  798. Xretained unchanged.
  799. X.TP
  800. X07-Mar-89  Michael L. Mauldin at Carnegie Mellon University
  801. XBeta release (version 0.9) mlm@cs.cmu.edu
  802. END_OF_FILE
  803. if test 966 -ne `wc -c <'fbinfo.1'`; then
  804.     echo shar: \"'fbinfo.1'\" unpacked with wrong size!
  805. fi
  806. # end of 'fbinfo.1'
  807. fi
  808. if test -f 'fbm2pod.1' -a "${1}" != "-c" ; then 
  809.   echo shar: Will not clobber existing file \"'fbm2pod.1'\"
  810. else
  811. echo shar: Extracting \"'fbm2pod.1'\" \(1122 characters\)
  812. sed "s/^X//" >'fbm2pod.1' <<'END_OF_FILE'
  813. X.TH FBM2POD 1 07-Mar-89
  814. X.CM 3
  815. X.SH NAME
  816. Xfbm2pod \- convert grayscale to Diablo graphics
  817. X.SH SYNOPSIS
  818. X.nf
  819. Xfbm2pod [ -fbc<parm> ] [-s<sharpen> ] [ size ] < 8bit > pod
  820. X.fi
  821. X.SH DESCRIPTION
  822. X.PP
  823. XEquivalent to
  824. X.I fbhalf,
  825. Xbut generates a file for the Diablo printer at 30 dpi horizontal and 24
  826. Xdpi vertical.
  827. X.SH EXAMPLE
  828. X.PP
  829. XGiven a grayscale image, reproduce it on a Diablo printer.  Use blue
  830. Xnoise dithering and size the output for about 25,000 pixels (around 5x7
  831. Xinches on a Diablo).  Use sharpening with beta=10 to enhance edges:
  832. X.sp
  833. X    % fbm2pod -s10 25000 < foo.8bit > foo.pod
  834. X.sp
  835. XAt CMU, the podtype(1) command is used to send files to Diablo printers.
  836. X.SH SEE ALSO
  837. Xfbhalf(1) for options,
  838. Xpodtype(1) for printing on Diablos,
  839. Xfbm(1) for general discussion,
  840. Xpbm(1) for PBM routines.
  841. X.SH BUGS
  842. XNone known.
  843. X.SH HISTORY
  844. XCopyright (c) 1989 by Michael L. Mauldin.  
  845. XPermission is granted to use this program in whole or in part provided
  846. Xthat you do not sell it for profit and that this copyright notice is
  847. Xretained unchanged.
  848. X.TP
  849. X07-Mar-89  Michael L. Mauldin at Carnegie Mellon University
  850. XBeta release (version 0.9) mlm@cs.cmu.edu
  851. END_OF_FILE
  852. if test 1122 -ne `wc -c <'fbm2pod.1'`; then
  853.     echo shar: \"'fbm2pod.1'\" unpacked with wrong size!
  854. fi
  855. # end of 'fbm2pod.1'
  856. fi
  857. if test -f 'fbm2tga.c' -a "${1}" != "-c" ; then 
  858.   echo shar: Will not clobber existing file \"'fbm2tga.c'\"
  859. else
  860. echo shar: Extracting \"'fbm2tga.c'\" \(1295 characters\)
  861. sed "s/^X//" >'fbm2tga.c' <<'END_OF_FILE'
  862. X/*****************************************************************
  863. X * fbm2tga.c: FBM Library 0.93 (Beta test) 03-May-89  Michael Mauldin
  864. X *
  865. X * Copyright (C) 1989 by Michael Mauldin.  Permission is granted to
  866. X * use this file in whole or in part provided that you do not sell it
  867. X * for profit and that this copyright notice is retained unchanged.
  868. X *
  869. X * fbm2tga.c: convert a bitmap to Targa format
  870. X *
  871. X * USAGE
  872. X *    % fbm2tga [ image ] > image.tga
  873. X *
  874. X * EDITLOG
  875. X *    LastEditDate = Wed May  3 21:50:43 1989 - Michael Mauldin
  876. X *    LastFileName = /usr2/mlm/src/misc/fbm/fbm2tga.c
  877. X *
  878. X * HISTORY
  879. X * 03-May-89  Michael Mauldin (mlm) at Carnegie Mellon University
  880. X *    Beta release (version 0.93) mlm@cs.cmu.edu
  881. X *****************************************************************/
  882. X
  883. X# include <stdio.h>
  884. X# include <math.h>
  885. X# include "fbm.h"
  886. X
  887. X# define USAGE\
  888. X"Usage: fbm2tga [ image ] > image.tga"
  889. X
  890. X#ifndef lint
  891. Xstatic char *fbmid =
  892. X    "$FBM fbm2tga.c <0.93> 03-May-89  (C) 1989 by Michael Mauldin$";
  893. X#endif
  894. X
  895. Xmain (argc,argv)
  896. Xint argc; char *argv[];
  897. X{ FBM image;
  898. X
  899. X  /* Clear pointers */
  900. X  image.cm = image.bm = (unsigned char *) NULL;
  901. X
  902. X  /* Read anything, write targa */
  903. X  if (read_bitmap (&image, (argc > 0) ? *argv : (char *) NULL) &&
  904. X      write_tga (&image, stdout))
  905. X  {
  906. X    exit (0);
  907. X  }
  908. X  else
  909. X  { exit (1); }
  910. X}
  911. END_OF_FILE
  912. if test 1295 -ne `wc -c <'fbm2tga.c'`; then
  913.     echo shar: \"'fbm2tga.c'\" unpacked with wrong size!
  914. fi
  915. # end of 'fbm2tga.c'
  916. fi
  917. if test -f 'fbmask.1' -a "${1}" != "-c" ; then 
  918.   echo shar: Will not clobber existing file \"'fbmask.1'\"
  919. else
  920. echo shar: Extracting \"'fbmask.1'\" \(1076 characters\)
  921. sed "s/^X//" >'fbmask.1' <<'END_OF_FILE'
  922. X.TH FBMASK 1 07-Mar-89
  923. X.CM 3
  924. X.SH NAME
  925. Xfbmask \- mask a rectangle in a grayscale file
  926. X.SH SYNOPSIS
  927. X.nf
  928. Xfbmask [ -<type> ] x0 y0 x1 y1 value < 8bit > 8bit
  929. X.fi
  930. X.SH DESCRIPTION
  931. X.PP
  932. XPaints the specified gray value
  933. X.I val
  934. Xin a rectangle starting at
  935. X.I x
  936. Xand
  937. X.I y
  938. Xwith the given 
  939. X.I width
  940. Xand
  941. X.I height.
  942. X.PP
  943. X.SH EXAMPLE
  944. XTo put a 50 pixel wide black border around a 640 by 480 pixel grayscale
  945. Ximage, you could use the following pipeline (which outputs a Sun
  946. Xrasterfile):
  947. X.sp
  948. X.nf
  949. X    % fbmask   0   0  50 480 0 < foo.8bit |
  950. X      fbmask   0   0 640  50 0 < foo.8bit |
  951. X      fbmask   0 430 640 480 0 < foo.8bit |
  952. X      fbmask 590   0 640 480 0 < foo.8bit > bar.8bit
  953. X.fi
  954. X.sp
  955. X.SH SEE ALSO
  956. Xfbm(1) for general discussion, pbm(1) for PBM routines.
  957. X.SH BUGS
  958. XNone known.
  959. X.SH HISTORY
  960. XCopyright (c) 1989 by Michael L. Mauldin.  
  961. XPermission is granted to use this program in whole or in part provided
  962. Xthat you do not sell it for profit and that this copyright notice is
  963. Xretained unchanged.
  964. X.TP
  965. X07-Mar-89  Michael L. Mauldin at Carnegie Mellon University
  966. XBeta release (version 0.9) mlm@cs.cmu.edu
  967. END_OF_FILE
  968. if test 1076 -ne `wc -c <'fbmask.1'`; then
  969.     echo shar: \"'fbmask.1'\" unpacked with wrong size!
  970. fi
  971. # end of 'fbmask.1'
  972. fi
  973. if test -f 'fbnorm.1' -a "${1}" != "-c" ; then 
  974.   echo shar: Will not clobber existing file \"'fbnorm.1'\"
  975. else
  976. echo shar: Extracting \"'fbnorm.1'\" \(1749 characters\)
  977. sed "s/^X//" >'fbnorm.1' <<'END_OF_FILE'
  978. X.TH FBNORM 1 07-Mar-89
  979. X.CM 3
  980. X.SH NAME
  981. Xfbnorm \- normalize and adjust grayscale or color image
  982. X.SH SYNOPSIS
  983. X.nf
  984. Xfbnorm [ -b<val> -w<val> ] [ -<type> ] < image > image
  985. X.fi
  986. X.SH DESCRIPTION
  987. X.PP
  988. XExtends the contrast range to a full 0 to 255.  The arguments
  989. X.B -b
  990. Xand
  991. X.B -w
  992. Xgiven the percentage of the darkest pixels to map to black and lightest
  993. Xpixels to map to white.
  994. X.sp
  995. XFor color images the default is to discard 0.5% each of the darkest and
  996. Xlightest pixels.  Increasing the contrast beyond that may result in
  997. Xsignificant color artifacts (because the color values will be partially
  998. Xclipped).
  999. X.SH OPTIONS
  1000. X.TP
  1001. X.BR -b<num>, -w<num>
  1002. X.I percentage black, white
  1003. Xpixels to map to 0, 255.  The default for grayscale images is to
  1004. X"discard" 2 percent of the black pixels and 1 percent of the white
  1005. Xpixels.  For color images both values default to 0.5 percent.
  1006. X.sp
  1007. XAn alternate form is to specify two integers, which will then be
  1008. Xlinearly mapped to 0 and 255.
  1009. X.SH EXAMPLE
  1010. X.PP
  1011. XTo normalize a grayscale FBM image using defaults:
  1012. X.sp
  1013. X    % fbnorm < foo.fbm > bar.fbm
  1014. X.sp
  1015. XTo increase contrast by discarding 10 percent of the black pixels and 5
  1016. Xpercent of the white pixels:
  1017. X.sp
  1018. X    % fbnorm -b10 -w5 < foo.fbm > bar.fbm
  1019. X.sp
  1020. XOr, if you know that you want 34 to map to 0 and 197 to map to 255, you
  1021. Xcan just type:
  1022. X.sp
  1023. X    % fbnorm 34 197 < foo.fbm > bar.fbm
  1024. X.SH SEE ALSO
  1025. Xfbm(1) for general discussion, pbm(1) for PBM routines.
  1026. X.SH BUGS
  1027. XNone known.
  1028. X.SH HISTORY
  1029. XCopyright (c) 1989 by Michael L. Mauldin.  
  1030. XPermission is granted to use this program in whole or in part provided
  1031. Xthat you do not sell it for profit and that this copyright notice is
  1032. Xretained unchanged.
  1033. X.TP
  1034. X07-Mar-89  Michael L. Mauldin at Carnegie Mellon University
  1035. XBeta release (version 0.9) mlm@cs.cmu.edu
  1036. END_OF_FILE
  1037. if test 1749 -ne `wc -c <'fbnorm.1'`; then
  1038.     echo shar: \"'fbnorm.1'\" unpacked with wrong size!
  1039. fi
  1040. # end of 'fbnorm.1'
  1041. fi
  1042. if test -f 'fbps.1' -a "${1}" != "-c" ; then 
  1043.   echo shar: Will not clobber existing file \"'fbps.1'\"
  1044. else
  1045. echo shar: Extracting \"'fbps.1'\" \(1658 characters\)
  1046. sed "s/^X//" >'fbps.1' <<'END_OF_FILE'
  1047. X.TH FBPS 1 07-Mar-89
  1048. X.CM 3
  1049. X.SH NAME
  1050. Xfbps \- convert grayscale to postscript
  1051. X.SH SYNOPSIS
  1052. X.nf
  1053. Xfbps [-tT] [-pP] [ -s ] [ -w<width> ] < grayscale > foo.PS
  1054. X.fi
  1055. X.SH DESCRIPTION
  1056. X.PP
  1057. XConverts an fbm format file into a postscript file for printing. The
  1058. X.B -s
  1059. Xflag generates a file suitable for including in a postscript document
  1060. X(for example, Scribe or LaTex output) with no document structuring,
  1061. Xtitles, or trailing "showpage".  By default, the image's title is
  1062. Xprinted in a large font centered over the image, and a small banner
  1063. Xgiving the size is printed under the lower right corner.
  1064. XThe
  1065. X.B -T
  1066. Xand 
  1067. X.B -P
  1068. Xarguments disable the title and print size options.
  1069. X.sp
  1070. XThere really ought to be an option to print the credits instead of the
  1071. Xsize, but I haven't done it yet.
  1072. X.SH EXAMPLE
  1073. X.PP
  1074. XTo convert a Sun 8bit grayscale rasterfile to a full page postscript file:
  1075. X.sp
  1076. X    % fbps < foo.8bit > foo.PS
  1077. X.sp
  1078. XTo convert a color GIF file to a 3 inch wide grayscale postscript file
  1079. Xfor inclusion in a Scribe or TeX document:
  1080. X.sp
  1081. X    % clr2gray < foo.gif | fbps -s -w3.0 > foo.PS
  1082. X.sp
  1083. XTo print a 1 bit deep Sun rasterfile in postscript, use fbcat and
  1084. Xpbm2ps:
  1085. X.sp
  1086. X    % fbcat -P < foo.1bit | pbm2ps > foo.PS
  1087. X.SH SEE ALSO
  1088. Xfbcat(1) and pbm2ps(1) for converting 1 bit deep files to PostScript.
  1089. Xfbm(1) for general discussion, pbm(1) for PBM routines.
  1090. X.SH BUGS
  1091. XNone known.
  1092. X.SH HISTORY
  1093. XCopyright (c) 1989 by Michael L. Mauldin.  
  1094. XPermission is granted to use this program in whole or in part provided
  1095. Xthat you do not sell it for profit and that this copyright notice is
  1096. Xretained unchanged.
  1097. X.TP
  1098. X07-Mar-89  Michael L. Mauldin at Carnegie Mellon University
  1099. XBeta release (version 0.9) mlm@cs.cmu.edu
  1100. END_OF_FILE
  1101. if test 1658 -ne `wc -c <'fbps.1'`; then
  1102.     echo shar: \"'fbps.1'\" unpacked with wrong size!
  1103. fi
  1104. # end of 'fbps.1'
  1105. fi
  1106. if test -f 'fbrot.1' -a "${1}" != "-c" ; then 
  1107.   echo shar: Will not clobber existing file \"'fbrot.1'\"
  1108. else
  1109. echo shar: Extracting \"'fbrot.1'\" \(1311 characters\)
  1110. sed "s/^X//" >'fbrot.1' <<'END_OF_FILE'
  1111. X.TH FBROT 1 07-Mar-89
  1112. X.CM 3
  1113. X.SH NAME
  1114. Xfbrot \- rotate an image 90, 180 or 270 degrees
  1115. X.SH SYNOPSIS
  1116. X.nf
  1117. Xfbrot [ -<type> ] [ -90 | -180 | -270 ] < bitmap > bitmap
  1118. X.fi
  1119. X.SH DESCRIPTION
  1120. X.PP
  1121. XRotate an image in increments of 90 degrees.
  1122. XThe direction is clockwise.
  1123. XThe default is 90 degrees clockwise.
  1124. X.SH OPTIONS
  1125. X.TP
  1126. X.B -90, -180, -270
  1127. Xamount of clockwise rotation  inb degrees.
  1128. X.TP
  1129. X.BR -B
  1130. X.I face
  1131. Xformat, as used by Bennet Yee's
  1132. X.I face
  1133. Xprogram at CMU. 
  1134. X.TP
  1135. X.BR -F
  1136. X.I FBM,
  1137. Xformat (by default, the default).  You are guaranteed not
  1138. Xto lose information by specifying FBM as the default.
  1139. X.TP
  1140. X.BR -G
  1141. X.I GIF,
  1142. XCompuserve GIF format.
  1143. X.TP
  1144. X.BR -I
  1145. X.I IFF
  1146. Xformat, interleaved bitmaps (ILBM), used by Amigas.
  1147. X.TP
  1148. X.BR -P
  1149. X.I PBM,
  1150. XJef Poskanzer's bitmap format.
  1151. X.TP
  1152. X.BR -S
  1153. X.I sun,
  1154. XSun rasterfiles (not run length encoded).
  1155. X.SH EXAMPLE
  1156. X.PP
  1157. XRotate a Sun rasterfile 90 degrees:
  1158. X.sp
  1159. X    % fbrot -90 -S < foo.1bit > bar.1bit
  1160. X.SH SEE ALSO
  1161. Xfbm(1) for general discussion, pbm(1) for PBM routines.
  1162. X.SH BUGS
  1163. XNone known.
  1164. X.SH HISTORY
  1165. XCopyright (c) 1989 by Michael L. Mauldin.  
  1166. XPermission is granted to use this program in whole or in part provided
  1167. Xthat you do not sell it for profit and that this copyright notice is
  1168. Xretained unchanged.
  1169. X.TP
  1170. X07-Mar-89  Michael L. Mauldin at Carnegie Mellon University
  1171. XBeta release (version 0.9) mlm@cs.cmu.edu
  1172. END_OF_FILE
  1173. if test 1311 -ne `wc -c <'fbrot.1'`; then
  1174.     echo shar: \"'fbrot.1'\" unpacked with wrong size!
  1175. fi
  1176. # end of 'fbrot.1'
  1177. fi
  1178. if test -f 'fbsharp.1' -a "${1}" != "-c" ; then 
  1179.   echo shar: Will not clobber existing file \"'fbsharp.1'\"
  1180. else
  1181. echo shar: Extracting \"'fbsharp.1'\" \(1795 characters\)
  1182. sed "s/^X//" >'fbsharp.1' <<'END_OF_FILE'
  1183. X.TH FBSHARP 1 07-Mar-89
  1184. X.CM 3
  1185. X.SH NAME
  1186. Xfbsharp \- edge enhance a grayscale or color image
  1187. X.SH SYNOPSIS
  1188. X.nf
  1189. Xfbsharp [ -<type> ] beta < image > image
  1190. X.fi
  1191. X.SH DESCRIPTION
  1192. X.PP
  1193. XUses a digital Laplacian filter to enhance the edges.  Typical values
  1194. Xof beta run from 1 to 20.  The default is 2.  This command works for
  1195. Xcolor images, but values of sharpening higher than 3 or 4 tend to create
  1196. Xlots of noisy artifiacts in the image.
  1197. X.sp
  1198. XThe
  1199. X.I fbhalf
  1200. Xcommand also calls the sharpening code implicitly if the
  1201. X.I -s
  1202. Xoptional is passed to
  1203. X.I fbhalf.
  1204. X.SH OPTIONS
  1205. X.TP
  1206. X.BR <beta>
  1207. Xspecifies the amount of sharpening.  Typical values run from 1 to 10,
  1208. Xhigher values can cause snow.
  1209. X.TP
  1210. X.BR -B
  1211. X.I face
  1212. Xformat, as used by Bennet Yee's
  1213. X.I face
  1214. Xprogram at CMU. 
  1215. X.TP
  1216. X.BR -F
  1217. X.I FBM,
  1218. Xformat (by default, the default).  You are guaranteed not
  1219. Xto lose information by specifying FBM as the default.
  1220. X.TP
  1221. X.BR -G
  1222. X.I GIF,
  1223. XCompuserve GIF format.
  1224. X.TP
  1225. X.BR -I
  1226. X.I IFF
  1227. Xformat, interleaved bitmaps (ILBM), used by Amigas.
  1228. X.TP
  1229. X.BR -P
  1230. X.I PBM,
  1231. XJef Poskanzer's bitmap format.
  1232. X.TP
  1233. X.BR -S
  1234. X.I sun,
  1235. XSun rasterfiles (not run length encoded).
  1236. X.SH EXAMPLE
  1237. X.PP
  1238. XSince the -s option of fbahlf(1) exists, you will probably only run
  1239. Xfbsharp on color images, which tolerate less sharpening.  Here we
  1240. Xsharpen an FBM format color image with beta=3 and quantize it for
  1241. Xdisplay on a Sun:
  1242. X.sp
  1243. X    % fbsharp 3.0 < foo.fbm | fbquant -S > foo.clr
  1244. X.SH SEE ALSO
  1245. Xfbm(1) for general discussion, pbm(1) for PBM routines.
  1246. X.SH BUGS
  1247. XNone known.
  1248. X.SH HISTORY
  1249. XCopyright (c) 1989 by Michael L. Mauldin.  
  1250. XPermission is granted to use this program in whole or in part provided
  1251. Xthat you do not sell it for profit and that this copyright notice is
  1252. Xretained unchanged.
  1253. X.TP
  1254. X07-Mar-89  Michael L. Mauldin at Carnegie Mellon University
  1255. XBeta release (version 0.9) mlm@cs.cmu.edu
  1256. END_OF_FILE
  1257. if test 1795 -ne `wc -c <'fbsharp.1'`; then
  1258.     echo shar: \"'fbsharp.1'\" unpacked with wrong size!
  1259. fi
  1260. # end of 'fbsharp.1'
  1261. fi
  1262. if test -f 'flalfb.c' -a "${1}" != "-c" ; then 
  1263.   echo shar: Will not clobber existing file \"'flalfb.c'\"
  1264. else
  1265. echo shar: Extracting \"'flalfb.c'\" \(2086 characters\)
  1266. sed "s/^X//" >'flalfb.c' <<'END_OF_FILE'
  1267. X/*****************************************************************
  1268. X * flalfb.c: FBM Library 0.9 (Beta test) 07-Mar-89  Michael Mauldin
  1269. X *
  1270. X * Copyright (C) 1989 by Michael Mauldin.  Permission is granted to
  1271. X * use this file in whole or in part provided that you do not sell it
  1272. X * for profit and that this copyright notice is retained unchanged.
  1273. X *
  1274. X * flalfb.c: Fuzzy bitmap allocation
  1275. X *
  1276. X * CONTENTS
  1277. X *    alloc_fbm (image)
  1278. X *    free_fbm (image)
  1279. X *
  1280. X * EDITLOG
  1281. X *    LastEditDate = Tue Mar  7 19:56:45 1989 - Michael Mauldin
  1282. X *    LastFileName = /usr2/mlm/src/misc/fbm/flalfb.c
  1283. X *
  1284. X * HISTORY
  1285. X * 07-Mar-89  Michael Mauldin (mlm) at Carnegie Mellon University
  1286. X *    Beta release (version 0.9) mlm@cs.cmu.edu
  1287. X *
  1288. X * 12-Nov-88  Michael Mauldin (mlm) at Carnegie-Mellon University
  1289. X *    Created.
  1290. X *****************************************************************/
  1291. X
  1292. X# include <stdio.h>
  1293. X# include <math.h>
  1294. X# include <ctype.h>
  1295. X# include "fbm.h"
  1296. X
  1297. X/****************************************************************
  1298. X * alloc_fbm: Allocate enough bytes for the bitmap and colormap
  1299. X *    of an image where the header has already been filled in.
  1300. X ****************************************************************/
  1301. X
  1302. X#ifndef lint
  1303. Xstatic char *fbmid =
  1304. X    "$FBM flalfb.c <0.9> 07-Mar-89  (C) 1989 by Michael Mauldin$";
  1305. X#endif
  1306. X
  1307. Xalloc_fbm (image)
  1308. XFBM *image;
  1309. X{ unsigned bmsize, cmsize;
  1310. X
  1311. X  if (! free_fbm (image)) return (0);
  1312. X
  1313. X  /* Calculate bytes needed */
  1314. X  bmsize = (image->hdr.planes * image->hdr.plnlen);
  1315. X  cmsize = image->hdr.clrlen;
  1316. X  
  1317. X  if (! (image->bm = (unsigned char *) malloc (bmsize)) ||
  1318. X      (cmsize && ! (image->cm = (unsigned char *) malloc (cmsize))))
  1319. X  { perror ("alloc_fbm"); exit (1); }
  1320. X
  1321. X  return (1);
  1322. X}
  1323. X
  1324. X/****************************************************************
  1325. X * free_fbm: Free the storage allocate by alloc_fbm
  1326. X ****************************************************************/
  1327. X
  1328. Xfree_fbm (image)
  1329. XFBM *image;
  1330. X{
  1331. X  if (image->bm)
  1332. X  { free ((char *) image->bm); image->bm = (unsigned char *) NULL; }
  1333. X
  1334. X  if (image->cm)
  1335. X  { free ((char *) image->cm); image->cm = (unsigned char *) NULL; }
  1336. X
  1337. X  return (1);
  1338. X}
  1339. END_OF_FILE
  1340. if test 2086 -ne `wc -c <'flalfb.c'`; then
  1341.     echo shar: \"'flalfb.c'\" unpacked with wrong size!
  1342. fi
  1343. # end of 'flalfb.c'
  1344. fi
  1345. if test -f 'flpic.c' -a "${1}" != "-c" ; then 
  1346.   echo shar: Will not clobber existing file \"'flpic.c'\"
  1347. else
  1348. echo shar: Extracting \"'flpic.c'\" \(1082 characters\)
  1349. sed "s/^X//" >'flpic.c' <<'END_OF_FILE'
  1350. X
  1351. X#include <stdio.h>
  1352. X#include "fbm.h"
  1353. X/*
  1354. X * read_pic(image, rfile, mstr, mlen)
  1355. X *
  1356. X */
  1357. X
  1358. Xread_pic(image, rfile, mstr, mlen)
  1359. XFBM *image;
  1360. XFILE *rfile;
  1361. Xchar *mstr;
  1362. Xint mlen;
  1363. X{
  1364. Xunsigned int        Width, Height;
  1365. Xint            i,j;
  1366. Xunsigned char        *Red, *Grn, *Blu;
  1367. X
  1368. Xfscanf(rfile,"%d %d\n",&Height,&Width);
  1369. X
  1370. X/* Create output image header */
  1371. X    image->hdr.rows = Height;
  1372. X    image->hdr.cols = Width;
  1373. X    /* If this is odd number of bytes, add one */
  1374. X    if ((image->hdr.cols & 1) != 0) image->hdr.cols++;
  1375. X    image->hdr.planes = 3;
  1376. X    image->hdr.bits = 8;
  1377. X    image->hdr.physbits = 8;
  1378. X    image->hdr.rowlen = image->hdr.cols;
  1379. X    image->hdr.plnlen = image->hdr.rows * image->hdr.cols;
  1380. X    image->hdr.clrlen = 0;
  1381. X    image->hdr.aspect = 1.0;
  1382. X    image->hdr.title[0] = '\0';
  1383. X    image->hdr.credits[0] = '\0';
  1384. X
  1385. X/* Get the Image */
  1386. X    alloc_fbm(image);
  1387. X
  1388. X    Red = image->bm;
  1389. X    Grn = Red + image->hdr.plnlen;
  1390. X    Blu = Grn + image->hdr.plnlen;
  1391. X    for (i=0; i< Height; i++)
  1392. X    {
  1393. X        for (j=0; j< Width; j++)
  1394. X        {
  1395. X            fread(Red++,1,1,rfile);
  1396. X            fread(Grn++,1,1,rfile);
  1397. X            fread(Blu++,1,1,rfile);
  1398. X        }
  1399. X        if (Width != image->hdr.cols)
  1400. X        {
  1401. X            Red++;Grn++;Blu++;
  1402. X        }
  1403. X    }
  1404. X}
  1405. END_OF_FILE
  1406. if test 1082 -ne `wc -c <'flpic.c'`; then
  1407.     echo shar: \"'flpic.c'\" unpacked with wrong size!
  1408. fi
  1409. # end of 'flpic.c'
  1410. fi
  1411. if test -f 'gray2clr.1' -a "${1}" != "-c" ; then 
  1412.   echo shar: Will not clobber existing file \"'gray2clr.1'\"
  1413. else
  1414. echo shar: Extracting \"'gray2clr.1'\" \(1559 characters\)
  1415. sed "s/^X//" >'gray2clr.1' <<'END_OF_FILE'
  1416. X.TH GRAY2CLR 1 07-Apr-89
  1417. X.CM 3
  1418. X.SH NAME
  1419. Xgray2clr, unmap \- add a colormap to a grayscale image, unmap a color image
  1420. X.SH SYNOPSIS
  1421. X.nf
  1422. Xgray2clr [ -<type> ] [ -u ] < gray > color    or
  1423. X.br
  1424. Xunmap [ -<type> ] < gray > color
  1425. X.fi
  1426. X.SH DESCRIPTION
  1427. X.PP
  1428. XAdds a colormap to an 8bit grayscale image, allowing it to be displayed
  1429. Xon a frame buffer.  The image will still be black and white, of course.
  1430. X.sp
  1431. XIf invoked as
  1432. X.I unmap,
  1433. Xor with the
  1434. X.B -u
  1435. Xoption, the output is given as RGB values instead of mapped color.
  1436. XThis routine can be used to convert mapped color to unmapped color as
  1437. Xwell.  This must be done before
  1438. X.I fbext
  1439. Xis used to resize a mapped color image.  Then the result can be
  1440. Xremapped using
  1441. X.I fbquant.
  1442. X.SH OPTIONS
  1443. X.TP
  1444. X.BR -u
  1445. X.I unmap,
  1446. Xmakes the output a 3 plane image, instead of a mapped imsage.
  1447. XThis must be done before the image can be resized (with fbext(1)) or
  1448. Xquantized (with fbquant(1)).
  1449. X.SH EXAMPLE
  1450. XAdd a colormap to a grayscale file for viewing on a frame buffer:
  1451. X.sp
  1452. X    % gray2clr -S < foo.8bit > foo.clr
  1453. X.sp
  1454. XConvert a mapped color image to unmapped and then adjust the aspect
  1455. Xratio:
  1456. X.sp
  1457. X    % gray2clr -u < foo.gif | fbext -a1 > foo.fbm
  1458. X.SH SEE ALSO
  1459. Xfbm(1) for general discussion, pbm(1) for PBM routines.
  1460. X.SH BUGS
  1461. XNone known.
  1462. X.SH HISTORY
  1463. XCopyright (c) 1989 by Michael L. Mauldin.  
  1464. XPermission is granted to use this program in whole or in part provided
  1465. Xthat you do not sell it for profit and that this copyright notice is
  1466. Xretained unchanged.
  1467. X.TP
  1468. X07-Apr-89  Michael L. Mauldin at Carnegie Mellon University
  1469. XBeta release (version 0.91) mlm@cs.cmu.edu
  1470. END_OF_FILE
  1471. if test 1559 -ne `wc -c <'gray2clr.1'`; then
  1472.     echo shar: \"'gray2clr.1'\" unpacked with wrong size!
  1473. fi
  1474. # end of 'gray2clr.1'
  1475. fi
  1476. if test -f 'idiff.1' -a "${1}" != "-c" ; then 
  1477.   echo shar: Will not clobber existing file \"'idiff.1'\"
  1478. else
  1479. echo shar: Extracting \"'idiff.1'\" \(1082 characters\)
  1480. sed "s/^X//" >'idiff.1' <<'END_OF_FILE'
  1481. X.TH IDIFF 1 07-Mar-89
  1482. X.CM 3
  1483. X.SH NAME
  1484. Xidiff, udiff \- convert byte stream to difference stream (b[n]-[bn-1])
  1485. X.SH SYNOPSIS
  1486. X.nf
  1487. Xidiff < original > delta
  1488. Xudiff < delta > original
  1489. X.fi
  1490. X.SH DESCRIPTION
  1491. X.PP
  1492. XUsed as a preprocessor for compression algorithms.  Some images
  1493. X(especially grayscale and RGB) compress better when the compression is
  1494. Xperformed on the difference between adjacent bytes, rather than the
  1495. Xbytes themselves (savings up to 30% are common).
  1496. X.sp
  1497. XUse
  1498. X.I idiff
  1499. Xto convert the original to a delta file, and
  1500. X.I udiff
  1501. Xto restore.
  1502. X.sp
  1503. XThere are no magic numbers or headers, so there is no good way to tell
  1504. Xwhether a file has been "idiffed" by examining the contents.
  1505. X.SH SEE ALSO
  1506. Xfbm(1) for general discussion, pbm(1) for PBM routines.
  1507. X.SH BUGS
  1508. XNone known.
  1509. X.SH HISTORY
  1510. XCopyright (c) 1989 by Michael L. Mauldin.  
  1511. XPermission is granted to use this program in whole or in part provided
  1512. Xthat you do not sell it for profit and that this copyright notice is
  1513. Xretained unchanged.
  1514. X.TP
  1515. X07-Mar-89  Michael L. Mauldin at Carnegie Mellon University
  1516. XBeta release (version 0.9) mlm@cs.cmu.edu
  1517. END_OF_FILE
  1518. if test 1082 -ne `wc -c <'idiff.1'`; then
  1519.     echo shar: \"'idiff.1'\" unpacked with wrong size!
  1520. fi
  1521. # end of 'idiff.1'
  1522. fi
  1523. if test -f 'idiff.c' -a "${1}" != "-c" ; then 
  1524.   echo shar: Will not clobber existing file \"'idiff.c'\"
  1525. else
  1526. echo shar: Extracting \"'idiff.c'\" \(1342 characters\)
  1527. sed "s/^X//" >'idiff.c' <<'END_OF_FILE'
  1528. X/*****************************************************************
  1529. X * idiff.c: FBM Library 0.9 (Beta test) 07-Mar-89  Michael Mauldin
  1530. X *
  1531. X * Copyright (C) 1989 by Michael Mauldin.  Permission is granted to
  1532. X * use this file in whole or in part provided that you do not sell it
  1533. X * for profit and that this copyright notice is retained unchanged.
  1534. X *
  1535. X * idiff.c: 
  1536. X *
  1537. X * USAGE
  1538. X *    % idiff [ flags ] arguments
  1539. X *
  1540. X * EDITLOG
  1541. X *    LastEditDate = Tue Mar  7 17:23:58 1989 - Michael Mauldin
  1542. X *    LastFileName = /usr2/mlm/src/misc/fbm/idiff.c
  1543. X *
  1544. X * HISTORY
  1545. X * 07-Mar-89  Michael Mauldin (mlm) at Carnegie Mellon University
  1546. X *    Beta release (version 0.9) mlm@cs.cmu.edu
  1547. X *
  1548. X * 18-Aug-88  Michael Mauldin (mlm) at Carnegie-Mellon University
  1549. X *    Created.
  1550. X *****************************************************************/
  1551. X
  1552. X# include <stdio.h>
  1553. X
  1554. X# define USAGE \
  1555. X"Usage: idiff < original > delta\n       udiff < delta > original"
  1556. X
  1557. X#ifndef lint
  1558. Xstatic char *fbmid =
  1559. X    "$FBM idiff.c <0.9> 07-Mar-89  (C) 1989 by Michael Mauldin$";
  1560. X#endif
  1561. X
  1562. Xmain (argc, argv)
  1563. Xchar *argv[];
  1564. X{ register int ch, lastch=0;
  1565. X
  1566. X  if (argc > 1 || !strcmp (argv[0] + strlen (argv[0]) - 5, "udiff"))
  1567. X  { while ((ch = getchar ()) != EOF)
  1568. X    { putchar (lastch = ((ch+lastch) & 255)); }
  1569. X  }
  1570. X  else
  1571. X  { while ((ch = getchar ()) != EOF)
  1572. X    { putchar ((ch-lastch) & 255);
  1573. X      lastch = ch;
  1574. X    }
  1575. X  }
  1576. X}
  1577. END_OF_FILE
  1578. if test 1342 -ne `wc -c <'idiff.c'`; then
  1579.     echo shar: \"'idiff.c'\" unpacked with wrong size!
  1580. fi
  1581. # end of 'idiff.c'
  1582. fi
  1583. if test -f 'pbm2ps.1' -a "${1}" != "-c" ; then 
  1584.   echo shar: Will not clobber existing file \"'pbm2ps.1'\"
  1585. else
  1586. echo shar: Extracting \"'pbm2ps.1'\" \(1740 characters\)
  1587. sed "s/^X//" >'pbm2ps.1' <<'END_OF_FILE'
  1588. X.TH PBM2PS 1 07-Mar-89
  1589. X.CM 3
  1590. X.SH NAME
  1591. Xpbm2ps \- convert a PBM file to postscript (option for Scribe files)
  1592. X.SH SYNOPSIS
  1593. X.nf
  1594. Xpbm2ps [ -s ] [ scale ] < pbm > postscript
  1595. X.fi
  1596. X.SH DESCRIPTION
  1597. X.PP
  1598. XThis is an enhanced version of Poskanzer's
  1599. X.I pbmtops
  1600. Xcommand that includes an option to generate "bare" files for including
  1601. Xin documents (the
  1602. X.B -s
  1603. Xor scribe option).  It also prints the title at the top, if there is
  1604. Xone attached to the image.
  1605. X.sp
  1606. XThe
  1607. X.I scale
  1608. Xif given must be an integer number which indicates how many output dots
  1609. X(at 300 dpi) are used to render a single pixel.  The default is 1.
  1610. X.SH EXAMPLE
  1611. X.PP
  1612. XGiven a 480 by 600 pixel bitmap, create a postscript file with the
  1613. Xlargest integral scaling factor that fits on a regular page:
  1614. X.sp
  1615. X    % pbm2ps < foo.1bit > foo.PS
  1616. X.sp
  1617. XGiven the same bitmap, create a postscript file
  1618. Xwith each input pixel represented by a 2x2
  1619. Xblock of 300 dpi pixels on the output page (scaling factor 2):
  1620. X.sp
  1621. X    % pbm2ps 2 < foo.1bit > foo.PS
  1622. X.sp
  1623. XNote that the resulting image will be 3.2 inches wide and 4 inches tall
  1624. X(pixels * scale / 300 dpi).
  1625. X.sp
  1626. XCreate the same image, but don't include document structuring commands
  1627. X(this allows the file to be included in other documents by formatters
  1628. Xsuch as Scribe and TeX).
  1629. X.sp
  1630. X    % pbm2ps -s 2 < foo.1bit > foo.PS
  1631. X.SH SEE ALSO
  1632. Xfbm2ps(1) for converting grayscale files.
  1633. Xfbm(1) for general discussion, pbm(1) for PBM routines.
  1634. X.SH BUGS
  1635. XNone known.
  1636. X.SH HISTORY
  1637. XCopyright (c) 1989 by Michael L. Mauldin.  
  1638. XPermission is granted to use this program in whole or in part provided
  1639. Xthat you do not sell it for profit and that this copyright notice is
  1640. Xretained unchanged.
  1641. X.TP
  1642. X07-Mar-89  Michael L. Mauldin at Carnegie Mellon University
  1643. XBeta release (version 0.9) mlm@cs.cmu.edu
  1644. END_OF_FILE
  1645. if test 1740 -ne `wc -c <'pbm2ps.1'`; then
  1646.     echo shar: \"'pbm2ps.1'\" unpacked with wrong size!
  1647. fi
  1648. # end of 'pbm2ps.1'
  1649. fi
  1650. if test -f 'pbmtitle.1' -a "${1}" != "-c" ; then 
  1651.   echo shar: Will not clobber existing file \"'pbmtitle.1'\"
  1652. else
  1653. echo shar: Extracting \"'pbmtitle.1'\" \(703 characters\)
  1654. sed "s/^X//" >'pbmtitle.1' <<'END_OF_FILE'
  1655. X.TH PBMTITLE 1 07-Mar-89
  1656. X.CM 3
  1657. X.SH NAME
  1658. Xpbmtitle \- add a title to PBM files (titles used in FBM files)
  1659. X.SH SYNOPSIS
  1660. X.nf
  1661. Xpbmtitle 'new title' < pbm > pbm
  1662. X.fi
  1663. X.SH DESCRIPTION
  1664. X.PP
  1665. XAdds or replaces the title of a pbm file.
  1666. X.SH EXAMPLE
  1667. X.PP
  1668. X.nf
  1669. X    pbmtitle -t'New title' < foo.pbm > bar.pbm
  1670. X.fi
  1671. X.SH SEE ALSO
  1672. Xfbm(1) for general discussion, pbm(1) for PBM routines.
  1673. X.SH BUGS
  1674. XNone known.
  1675. X.SH HISTORY
  1676. XCopyright (c) 1989 by Michael L. Mauldin.  
  1677. XPermission is granted to use this program in whole or in part provided
  1678. Xthat you do not sell it for profit and that this copyright notice is
  1679. Xretained unchanged.
  1680. X.TP
  1681. X07-Mar-89  Michael L. Mauldin at Carnegie Mellon University
  1682. XBeta release (version 0.9) mlm@cs.cmu.edu
  1683. END_OF_FILE
  1684. if test 703 -ne `wc -c <'pbmtitle.1'`; then
  1685.     echo shar: \"'pbmtitle.1'\" unpacked with wrong size!
  1686. fi
  1687. # end of 'pbmtitle.1'
  1688. fi
  1689. if test -f 'pbmtitle.c' -a "${1}" != "-c" ; then 
  1690.   echo shar: Will not clobber existing file \"'pbmtitle.c'\"
  1691. else
  1692. echo shar: Extracting \"'pbmtitle.c'\" \(1429 characters\)
  1693. sed "s/^X//" >'pbmtitle.c' <<'END_OF_FILE'
  1694. X/*****************************************************************
  1695. X * pbmtitle.c: FBM Library 0.9 (Beta test) 07-Mar-89  Michael Mauldin
  1696. X *
  1697. X * Copyright (C) 1989 by Michael Mauldin.  Permission is granted to
  1698. X * use this file in whole or in part provided that you do not sell it
  1699. X * for profit and that this copyright notice is retained unchanged.
  1700. X *
  1701. X * pbmtitle.c: Add a title to a pbm bitmap
  1702. X *
  1703. X * USAGE
  1704. X *    % pbmtitle [ flags ] arguments
  1705. X *
  1706. X * EDITLOG
  1707. X *    LastEditDate = Tue Mar  7 19:57:46 1989 - Michael Mauldin
  1708. X *    LastFileName = /usr2/mlm/src/misc/fbm/pbmtitle.c
  1709. X *
  1710. X * HISTORY
  1711. X * 07-Mar-89  Michael Mauldin (mlm) at Carnegie Mellon University
  1712. X *    Beta release (version 0.9) mlm@cs.cmu.edu
  1713. X *
  1714. X * 23-Sep-88  Michael Mauldin (mlm) at Carnegie-Mellon University
  1715. X *    Created.
  1716. X *****************************************************************/
  1717. X
  1718. X# include <stdio.h>
  1719. X
  1720. X# define USAGE "Usage: pbmtitle 'new title' < pbm > pbm"
  1721. X
  1722. X#ifndef lint
  1723. Xstatic char *fbmid =
  1724. X    "$FBM pbmtitle.c <0.9> 07-Mar-89  (C) 1989 by Michael Mauldin$";
  1725. X#endif
  1726. X
  1727. Xmain (argc, argv)
  1728. Xchar *argv[];
  1729. X{ char buf[BUFSIZ];
  1730. X  int lines=0;
  1731. X
  1732. X  if (argc != 2 || argv[1][0] == '-')
  1733. X  { fprintf (stderr, "%s\n", USAGE);
  1734. X    exit (1);
  1735. X  }
  1736. X  
  1737. X  while (fgets (buf, BUFSIZ, stdin))
  1738. X  { if (buf[0] != '#') { printf ("%s", buf); lines++; }
  1739. X    else if (strncmp (buf, "# Title: ", 9)) printf ("%s", buf);
  1740. X    
  1741. X    if (lines == 2) printf ("# Title: %s\n", argv[1]);
  1742. X  }
  1743. X  
  1744. X  exit (0);
  1745. X}
  1746. END_OF_FILE
  1747. if test 1429 -ne `wc -c <'pbmtitle.c'`; then
  1748.     echo shar: \"'pbmtitle.c'\" unpacked with wrong size!
  1749. fi
  1750. # end of 'pbmtitle.c'
  1751. fi
  1752. if test -f 'pic2fbm.c' -a "${1}" != "-c" ; then 
  1753.   echo shar: Will not clobber existing file \"'pic2fbm.c'\"
  1754. else
  1755. echo shar: Extracting \"'pic2fbm.c'\" \(1377 characters\)
  1756. sed "s/^X//" >'pic2fbm.c' <<'END_OF_FILE'
  1757. X/*****************************************************************
  1758. X * pic2fbm.c: FBM Library 0.93 (Beta test) 03-May-89  Michael Mauldin
  1759. X *
  1760. X * Copyright (C) 1989 by Michael Mauldin.  Permission is granted to
  1761. X * use this file in whole or in part provided that you do not sell it
  1762. X * for profit and that this copyright notice is retained unchanged.
  1763. X *
  1764. X * pic2fbm.c: convert a bitmap to Targa format
  1765. X *
  1766. X * USAGE
  1767. X *    % pic2fbm [ image.pic ] > image.fbm
  1768. X *
  1769. X * EDITLOG
  1770. X *    LastEditDate = Wed May  3 21:50:43 1989 - Michael Mauldin
  1771. X *    LastFileName = /usr2/mlm/src/misc/fbm/pic2fbm.c
  1772. X *
  1773. X * HISTORY
  1774. X * 03-May-89  Michael Mauldin (mlm) at Carnegie Mellon University
  1775. X *    Beta release (version 0.93) mlm@cs.cmu.edu
  1776. X *****************************************************************/
  1777. X
  1778. X# include <stdio.h>
  1779. X# include <math.h>
  1780. X# include "fbm.h"
  1781. X
  1782. X# define USAGE\
  1783. X"Usage: pic2fbm [ image.pic ] > image.fbm"
  1784. X
  1785. X#ifndef lint
  1786. Xstatic char *fbmid =
  1787. X    "$FBM pic2fbm.c <0.93> 03-May-89  (C) 1989 by Michael Mauldin$";
  1788. X#endif
  1789. Xmain(argc,argv)
  1790. Xint argc; char *argv[];
  1791. X{ FBM image;
  1792. X
  1793. X  /* Clear pointers */
  1794. X  image.cm = image.bm = (unsigned char *) NULL;
  1795. X
  1796. X  /* Open input if given */
  1797. X  if (argc > 1)
  1798. X  { if (freopen (argv[1], "r", stdin) != stdin)
  1799. X    { perror (argv[1]);
  1800. X      exit(1);
  1801. X    }
  1802. X  }
  1803. X
  1804. X  if (read_pic (&image, stdin, "", 0) &&
  1805. X       write_fbm (&image, stdout))
  1806. X  { exit(0); }
  1807. X  else
  1808. X  { exit (1); }
  1809. X}
  1810. END_OF_FILE
  1811. if test 1377 -ne `wc -c <'pic2fbm.c'`; then
  1812.     echo shar: \"'pic2fbm.c'\" unpacked with wrong size!
  1813. fi
  1814. # end of 'pic2fbm.c'
  1815. fi
  1816. if test -f 'qrt2fbm.1' -a "${1}" != "-c" ; then 
  1817.   echo shar: Will not clobber existing file \"'qrt2fbm.1'\"
  1818. else
  1819. echo shar: Extracting \"'qrt2fbm.1'\" \(1095 characters\)
  1820. sed "s/^X//" >'qrt2fbm.1' <<'END_OF_FILE'
  1821. X.TH QRT2FBM 1 07-Mar-89
  1822. X.CM 3
  1823. X.SH NAME
  1824. Xqrt2fbm \- convert QRT image files to FBM format (Output from the QRT ray tracer)
  1825. X.SH SYNOPSIS
  1826. X.nf
  1827. Xqrt2fbm [ -t'title' -c'credits' ] < rawfile > fbm
  1828. X.fi
  1829. X.SH DESCRIPTION
  1830. X.PP
  1831. XConverts a file in the format ouput by the QRT ray tracing package to
  1832. Xfbm format.
  1833. X.SH OPTIONS
  1834. X.TP
  1835. X.BR -t'title'
  1836. X.I title,
  1837. Xspecify a character string (up to 80 characters) to describe the image.
  1838. XThe default is no title.
  1839. X.TP
  1840. X.BR -c'credits'
  1841. X.I credits or subtitle,
  1842. Xspecify a second character string (up to 80 characters) to describe the
  1843. Ximage.  The default is no credit string.
  1844. X.SH EXAMPLE
  1845. X.PP
  1846. X    qrt2fbm -t'Tiger' -c'Joe' < tiger.raw > tiger.fbm
  1847. X.SH SEE ALSO
  1848. Xfbm(1) for general discussion, pbm(1) for PBM routines.
  1849. X.SH BUGS
  1850. XNone known.
  1851. X.SH HISTORY
  1852. XCopyright (c) 1989 by Michael L. Mauldin.  
  1853. XModified by Butler Hine.
  1854. XPermission is granted to use this program in whole or in part provided
  1855. Xthat you do not sell it for profit and that this copyright notice is
  1856. Xretained unchanged.
  1857. X.TP
  1858. X07-Mar-89  Michael L. Mauldin at Carnegie Mellon University
  1859. XBeta release (version 0.9) mlm@cs.cmu.edu
  1860. END_OF_FILE
  1861. if test 1095 -ne `wc -c <'qrt2fbm.1'`; then
  1862.     echo shar: \"'qrt2fbm.1'\" unpacked with wrong size!
  1863. fi
  1864. # end of 'qrt2fbm.1'
  1865. fi
  1866. if test -f 'raw2fbm.1' -a "${1}" != "-c" ; then 
  1867.   echo shar: Will not clobber existing file \"'raw2fbm.1'\"
  1868. else
  1869. echo shar: Extracting \"'raw2fbm.1'\" \(1901 characters\)
  1870. sed "s/^X//" >'raw2fbm.1' <<'END_OF_FILE'
  1871. X.TH RAW2FBM 1 07-Mar-89
  1872. X.CM 3
  1873. X.SH NAME
  1874. Xraw2fbm \- convert raw image files to FBM format (especially Digi-View files)
  1875. X.SH SYNOPSIS
  1876. X.nf
  1877. Xraw2fbm [ -t'title' -c'credits' -a<aspect>
  1878. X          -w<width> -h<height> -d'<planes> ] < rawfile > fbm
  1879. X.fi
  1880. X.SH DESCRIPTION
  1881. X.PP
  1882. XConverts a raw image (stored in row major order, or red/green/blue for
  1883. Xcolor images) to fbm format.  The defaults are width=640, height=400,
  1884. Xdepth=1, and aspect ratio=1.2 (the correct settings for output
  1885. Xfrom the Amiga Digi-View package).
  1886. X.SH OPTIONS
  1887. X.TP
  1888. X.BR -d
  1889. X.I depth,
  1890. Xnumber of byte planes in image.  Default is 1.  Use -d3 for RGB color
  1891. Ximages.
  1892. X.TP
  1893. X.BR -w
  1894. X.I width,
  1895. Xnumber of pixels per row, assumes 1 byte per pixel.  The default is 640.
  1896. X.TP
  1897. X.BR -h
  1898. X.I height,
  1899. Xnumber of rows in image.  The default is 400.
  1900. X.TP
  1901. X.BR -a
  1902. X.I aspect ratio,
  1903. Xthe ratio of the height to width of a single pixel.  The default is 1.2
  1904. X(for Digi-View files).
  1905. X.TP
  1906. X.BR -t'title'
  1907. X.I title,
  1908. Xspecify a character string (up to 80 characters) to describe the image.
  1909. XThe default is no title.
  1910. X.TP
  1911. X.BR -c'credits'
  1912. X.I credits or subtitle,
  1913. Xspecify a second character string (up to 80 characters) to describe the
  1914. Ximage.  The default is no credit string.
  1915. X.SH EXAMPLE
  1916. X.PP
  1917. XAssume a Digi-View "raw" color image of a tiger, 640x400 pixels with
  1918. X1.2 to 1 aspect ratio (EL Arts calls is 1.1):
  1919. X.sp
  1920. X    % raw2fbm -a1.2 -w640 -h400 -d3 \
  1921. X.br
  1922. X      -t'Tiger' -c'Joe' < tiger.raw > tiger.fbm
  1923. X.sp
  1924. Xor in this case:
  1925. X.sp
  1926. X    % raw2fbm -d3 -t'Tiger' -c'Joe' < tiger.raw > tiger.fbm
  1927. X.SH SEE ALSO
  1928. Xfbm(1) for general discussion, pbm(1) for PBM routines.
  1929. X.SH BUGS
  1930. XNone known.
  1931. X.SH HISTORY
  1932. XCopyright (c) 1989 by Michael L. Mauldin.  
  1933. XPermission is granted to use this program in whole or in part provided
  1934. Xthat you do not sell it for profit and that this copyright notice is
  1935. Xretained unchanged.
  1936. X.TP
  1937. X07-Mar-89  Michael L. Mauldin at Carnegie Mellon University
  1938. XBeta release (version 0.9) mlm@cs.cmu.edu
  1939. END_OF_FILE
  1940. if test 1901 -ne `wc -c <'raw2fbm.1'`; then
  1941.     echo shar: \"'raw2fbm.1'\" unpacked with wrong size!
  1942. fi
  1943. # end of 'raw2fbm.1'
  1944. fi
  1945. if test -f 'tga2fbm.c' -a "${1}" != "-c" ; then 
  1946.   echo shar: Will not clobber existing file \"'tga2fbm.c'\"
  1947. else
  1948. echo shar: Extracting \"'tga2fbm.c'\" \(1373 characters\)
  1949. sed "s/^X//" >'tga2fbm.c' <<'END_OF_FILE'
  1950. X/*****************************************************************
  1951. X * tga2fbm.c: FBM Library 0.93 (Beta test) 03-May-89  Michael Mauldin
  1952. X *
  1953. X * Copyright (C) 1989 by Michael Mauldin.  Permission is granted to
  1954. X * use this file in whole or in part provided that you do not sell it
  1955. X * for profit and that this copyright notice is retained unchanged.
  1956. X *
  1957. X * tga2fbm.c: convert a bitmap to Targa format
  1958. X *
  1959. X * USAGE
  1960. X *    % tga2fbm [ image ] > image.tga
  1961. X *
  1962. X * EDITLOG
  1963. X *    LastEditDate = Wed May  3 21:50:43 1989 - Michael Mauldin
  1964. X *    LastFileName = /usr2/mlm/src/misc/fbm/tga2fbm.c
  1965. X *
  1966. X * HISTORY
  1967. X * 03-May-89  Michael Mauldin (mlm) at Carnegie Mellon University
  1968. X *    Beta release (version 0.93) mlm@cs.cmu.edu
  1969. X *****************************************************************/
  1970. X
  1971. X# include <stdio.h>
  1972. X# include <math.h>
  1973. X# include "fbm.h"
  1974. X
  1975. X# define USAGE\
  1976. X"Usage: tga2fbm [ image ] > image.tga"
  1977. X
  1978. X#ifndef lint
  1979. Xstatic char *fbmid =
  1980. X    "$FBM tga2fbm.c <0.93> 03-May-89  (C) 1989 by Michael Mauldin$";
  1981. X#endif
  1982. X
  1983. Xmain (argc, argv)
  1984. Xint argc;
  1985. Xchar *argv[];
  1986. X{ FBM image;
  1987. X
  1988. X  /* Clear pointers */
  1989. X  image.cm = image.bm = (unsigned char *) NULL;
  1990. X
  1991. X  /* Open input if given */
  1992. X  if (argc > 1)
  1993. X  { if (freopen (argv[1], "r", stdin) != stdin)
  1994. X    { perror (argv[1]);
  1995. X      exit(1);
  1996. X    }
  1997. X  }
  1998. X
  1999. X  if (read_tga (&image, stdin, "", 0) &&
  2000. X       write_fbm (&image, stdout))
  2001. X  { exit(0); }
  2002. X  else
  2003. X  { exit (1); }
  2004. X}
  2005. X
  2006. END_OF_FILE
  2007. if test 1373 -ne `wc -c <'tga2fbm.c'`; then
  2008.     echo shar: \"'tga2fbm.c'\" unpacked with wrong size!
  2009. fi
  2010. # end of 'tga2fbm.c'
  2011. fi
  2012. echo shar: End of archive 1 \(of 8\).
  2013. cp /dev/null ark1isdone
  2014. MISSING=""
  2015. for I in 1 2 3 4 5 6 7 8 ; do
  2016.     if test ! -f ark${I}isdone ; then
  2017.     MISSING="${MISSING} ${I}"
  2018.     fi
  2019. done
  2020. if test "${MISSING}" = "" ; then
  2021.     echo You have unpacked all 8 archives.
  2022.     rm -f ark[1-9]isdone
  2023. else
  2024.     echo You still need to unpack the following archives:
  2025.     echo "        " ${MISSING}
  2026. fi
  2027. ##  End of shell archive.
  2028. exit 0
  2029.